Sensor system

ABSTRACT

Disclosed is a method for adjusting a sensor signal and a corresponding sensor system comprising a sensor for providing a sensor signal representative of a measure other than temperature, dynamic components of the sensor signal being dependent on temperature. In addition there is provided a temperature sensor for measuring the temperature. Dynamic components in the sensor signal are adjusted subject to the temperature sensed, and a compensated sensor signal is supplied. Such sensor system helps compensating for long response times of sensors.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the priority of European Patent Application10005804.9, filed Jun. 4, 2010, the disclosure of which is incorporatedherein by reference in its entirety.

BACKGROUND OF THE INVENTION

It is the nature of sensors that they react on real impacts with acertain time lag. Especially, this is true in fast varying environmentsin which the quantity to be measured may change in form of a stepfunction, for example. However, the corresponding sensor signal may notstep up to the new real measure value but rather gets there with acertain response time.

There are many applications that only work properly with a sensorsupplying a fast response to fast varying measures. However, for manysensors there are limitations in modifying the hardware in order toimprove the response time.

BRIEF SUMMARY OF THE INVENTION

The problem to be solved by the present invention is therefore toprovide a sensor and a method for providing a sensor signal withimproved response time. It is also desired to provide a method forbuilding such a sensor system or pieces of it respectively.

The problem is solved by a sensor system according to the features ofclaim 1, by a method for adjusting a sensor signal according to thefeatures of claim 7, and by a method for building a compensation filterfor use in a sensor system according to the features of claim 12.

According to a first aspect of the present invention, there is provideda sensor system comprising a sensor providing a sensor signalrepresentative of a measure other than temperature, wherein dynamiccomponents of the sensor signal are dependent on temperature. The systemfurther includes a temperature sensor for providing a temperaturesignal. A compensation filter receives the sensor signal and thetemperature signal. The compensation filter is designed for adjustingthe dynamic components in the sensor signal subject to the temperaturesignal, and for providing a compensated sensor signal.

According to another aspect of the present invention, there is provideda method for adjusting a sensor signal. According to this method atemperature is sensed and a sensor signal representative of a measureother than temperature is provided. Dynamic components of this sensorsignal typically are dependent on temperature. The dynamic components inthe sensor signal are adjusted subject to the temperature sensed. Acompensated sensor signal is provided as a result of this adjustment.

Sensors may not immediately react to changes in a measure but only reactwith a certain delay, also called response time. Such time lag may beowed to the appearance of diffusion processes, which may include adiffusion of the measure into the sensor—e.g. into a housing of thesensor—and, in addition, possibly a diffusion of the measure into asensor element of the sensor. For some sensors and applications,chemical reactions of the measure with the sensor element may increasethe response time, too. While a sensor may perfectly map a staticmeasure into its sensor signal, dynamic components in the measure, suchas swift changes, steps, or other high-frequent changes may be followedonly with a delay in time.

For such sensors/applications it may be beneficial if the sensorresponse is dynamically compensated. This means, that the sensor signal,and in particular the dynamic components of the sensor signal areadjusted such that the response time of the sensor is decreased. Sucheffort in decreasing the response time of a sensor is also understood ascompensation of the sensor signal and especially its dynamic components.

By using a dynamic compensation filter the response of a sensor, i.e.its output in response to a change in the measure, will be accelerated.If the dynamics of the sensor including its housing are known, anobserver, i.e. a compensation filter, can be implemented to estimate thetrue physical value of the measure. This observer compensates for thesensor dynamics such that the response can be considerably acceleratedin time, which means that the response time can be considerablydecreased. This is why the proposed method and system enhance the systemdynamics of sensors.

It has been observed that the dynamic components of a sensorresponse—e.g. the gradient in the sensor signal—may be dependent on theambient temperature, such that for example the response time of thesensor may be shorter at higher temperatures, and may take longer atlower temperatures. Consequently, in the present embodiments, it isenvisaged to apply a compensating filter to the sensor output whichcompensating filter takes the measured temperature into account. As aresult the compensated sensor signal supplied by the compensating filteris even more enhanced in that its deviation from the real measure isimproved for the reason that temperature dependency of the sensordynamics is taken into account of the compensation filter modelling.

Another aspect of the invention provides a method for building acompensation filter for use in a sensor system. In this method, a sensormodel of the sensor is built, the sensor model being characterized by atransfer function. A compensation filter is modelled based on an inverseof the transfer function of the sensor model. Temperature dependentterms are applied to the compensation filter.

In another aspect of the present invention, there is disclosed acomputer program element for adjusting a sensor signal, the computerprogram element comprising computer program instructions executable by acomputer to receive a sensor signal representative of a measure otherthan temperature, dynamic components of the sensor signal beingdependent on temperature, to adjust the dynamic components in the sensorsignal subject to the temperature sensed, and to provide a compensatedsensor signal.

Other advantageous embodiments are listed in the dependent claims aswell as in the description below. The described embodiments similarlypertain to the system, the methods, and the computer program element.Synergetic effects may arise from different combinations of theembodiments although they might not be described in detail.

Further on it shall be noted that all embodiments of the presentinvention concerning a method might be carried out with the order of thesteps as described, nevertheless this has not to be the only essentialorder of the steps of the method all different orders of orders andcombinations of the method steps are herewith described.

BRIEF DESCRIPTION OF THE DRAWINGS

The aspects defined above and further aspects, features and advantagesof the present invention can also be derived from the examples ofembodiments to be described hereinafter and are explained with referenceto examples of embodiments. The invention will be described in moredetail hereinafter with reference of examples of embodiments but towhich the invention is not limited.

FIG. 1 shows a diagram illustrating a change in a measure and associatedsensor signals for different ambient temperatures,

FIG. 2 shows a schematic illustration of a sensor system according to anembodiment of the present invention in a block diagram,

FIG. 3A illustrates diagrams with sample measures, associated sensorsignals, and associated compensated sensor signals,

FIG. 3B illustrates diagrams with sample measures, associated sensorsignals, and associated compensated sensor signals,

FIG. 4A shows a graph of signals in the discrete time domain whichsignals appear in a sensor system of an embodiment according to thepresent invention,

FIG. 4B shows graphs of signals in the discrete time domain whichsignals appear in a sensor system of an embodiment according to thepresent invention,

FIG. 4C shows a graph of a signal in the discrete time domain whichsignals appear in a sensor system of an embodiment according to thepresent invention,

FIG. 5A illustrates graphs for supporting the understanding of how tobuild a compensation filter according to an embodiment of the presentinvention,

FIG. 5B illustrates graphs for supporting the understanding of how tobuild a compensation filter according to an embodiment of the presentinvention,

FIG. 6A illustrates graphs for supporting the understanding of how tobuild a compensation filter according to another embodiment of thepresent invention,

FIG. 6B illustrates graphs for supporting the understanding of how tobuild a compensation filter according to another embodiment of thepresent invention,

FIG. 6C illustrates graphs for supporting the understanding of how tobuild a compensation filter according to another embodiment of thepresent invention, and

FIG. 7 illustrates on a temperature scale with different temperaturesub-ranges a measure may be exposed to.

DETAILED DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a diagram with a step function st representing an immediatechange in the quantity of a measure to be measured. An x-axis of thediagram indicates time in s, the y axis indicates the quantity of themeasure to be measured, in this particular case the relative humidityRH(t) in %. Accordingly, at t=0 the relative humidity RH steps up from20% to 80%. The other graphs in the diagram indicate sensor signals overtime provided by a relative humidity sensor in response to the stepfunction st of the relative humidity. It can be derived from thesegraphs that the humidity sensor cannot immediately follow the change inthe measure and approaches the new relative humidity of 80% only with adelay which delay is also called response time. The various graphsrepresent sensor signals subject to different ambient temperatures inCelsius degrees. Basically, the higher the ambient temperature is thefaster the response time of the sensor signal is. The lower the ambienttemperature is the longer the response time of the sensor signal is.

FIG. 2 shows a schematic illustration of a sensor system according to anembodiment of the present invention. A relative humidity sensor 1 sensesthe ambient relative humidity RH. In the following, the term humidity isused as a synonym for relative humidity. The physics of the humiditysensor 1 is such that dynamics of the sensor signal RH_(sensor) at itsoutput is temperature dependent. Insofar, the humidity sensor 1 of FIG.2 may behave according to a humidity sensor providing a temperaturedependent output according to the graphs in FIG. 1. This means that theresponse time of the humidity sensor is dependent from the ambienttemperature T. Accordingly, in FIG. 2 the ambient temperature T isillustrated as input to the humidity sensor 1 although the humiditysensor 1 is not meant to measure the ambient temperature 1 but ratherthe dynamics of the sensor signal RH_(sensor) at its output is varyingsubject to the ambient temperature T.

A second sensor is provided, which is a temperature sensor 2 formeasuring the ambient temperature T. The output of the temperaturesensor 2 provides a temperature signal T representing the ambienttemperature T.

A compensator 3 receives the sensor signal RH_(sensor)(t) overtime—which sensor signal is also denoted as u(t)—and the temperaturesignal T(t) over time, and adjusts the dynamics in the sensor signalRH_(sensor)(t) subject to the temperature signal T(t). As a result ofthis adjustment, the compensator 3 provides at its output a compensatedsensor signal RH_(compensated)(t) over time. In qualitative terms, thecompensated sensor signal RH_(compensated)(t) shall compensate for theresponse time of the humidity sensor 1 at its best and take a gradientthat is more close to the gradient of the measure to be measured. Assuch, the compensator 3 adjusts for the dynamics of the sensor signalRH_(sensor)(t) and consequently for the physics of the sensor 1 notallowing for better response times.

In order to build a compensator 3 that actually compensates for thedynamics of the sensor 1 in the desired way, the behaviour of the sensor1 needs to be understood. While the following sections are described inconnection with humidity sensing, it is understood that the principlescan be generalized to any other sensor which shows a response time notsatisfying for an application the sensor is used in and in particular atemperature dependent response time.

Modelling the Sensor:

The following desrcibes the modelling of a humidity sensor out of whichmodel a suitable compensator may be derived. Such compensator may beapplied downstream to the real sensor and compensate for dynamics in thesensor signal output by such sensor.

For a humidity sensor, the humidity as the relevant measure needs toreach a sensing element of the humidity sensor. Such sensing element ofa humidity sensor preferably is a membrane. For further information onhumidity sensing background it is referred to EP 1 700 724.Consequently, the humidity to be measured needs to diffuse into themembrane of the humidity sensor. Prior to this, the humidity needs todiffuse into a housing of the humidity sensor provided the humiditysensor has such housing.

For humidity sensors for which both of these diffusion processes—i.e.from the outside into the housing and from the housing into the sensorelement—are relevant both processes are preferred to be respected in acorresponding sensor model.

Both of the processes may be described with a differential diffusionequation with two independent diffusion time constants. In a firstapproximation, the sensor can be described by a transfer function in thefrequency domain with two poles and one zero such that the genericdesign of a corresponding transfer function G₂(s) may look like,specifically in a second order model:

$\begin{matrix}{{{G_{2}(s)} = \frac{{Ks} + 1}{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}},} & \left( {{Eq}.\mspace{14mu} 1} \right)\end{matrix}$

where s denotes the complex Laplace variable and K, T₁, T₂ are constantsto be identified. T₁ and T₂ are time constants of the respectivediffusion processes and K defines a coupling between the two processes.The transfer function G(s) generally describes the characteristics ofthe sensor in the frequency domain by

RH _(sensor)(s)=G(s)*RH(s)

If the housing of the humidity sensor is very complex, an additionalpole and zero may be added, and the transfer function of the humiditysensor may be amended accordingly.

Some other applications may require a less complex sensorrepresentation. In this case, a first order model may approximate thesensor, which first order model is characterized by a transfer functionin the frequency domain with one pole such that the generic design ofsuch transfer function G₁(s) may look like, specifically in a firstorder model:

$\begin{matrix}{{G_{1}(s)} = {\frac{1}{\left( {{T_{1}s} + 1} \right)}.}} & \left( {{Eq}.\mspace{14mu} 2} \right)\end{matrix}$

Such model may be sufficient, for example, if the humidity sensor doesnot include a housing such that the diffusion process into the housingcan be neglected, or, if one of the two diffusion processes—either fromthe outside into the housing or from the housing into the sensorelement—is dominant over the other, such that the transfer function maybe approximated by the dominant diffusion process only.

There are different ways for identifying the parameters T₁, T₂ and K.One approach is to find the parameters by trial and error. In a firsttrial, the sensor output is simulated by the sensor model wherein thesensor model makes use of a first estimation of the parameters. Theoutput of the sensor model then is compared with the sensor signalsupplied by the real sensor. Afterwards, the parameters are adjusteduntil a deviation between the simulated sensor output and the realsensor signal is acceptably small.

For implementing the sensor model in a digital system such as amicrocontroller the sensor model preferably is implemented in thediscrete time domain rather than in the continuous frequency domain asdescribed by equations 1 or 2. Therefore, the sensor model needs to bedigitised, i.e. transformed into a set of difference equations.

First, the differential equations in the frequency domain, e.g. theequations 1 and 2, can be reverse transformed into the time continuousdomain by the Laplace back-transform.

For the second order model of the sensor according to equation 1 theequivalent time continuous state space description in the controlcanonical form is:

$\begin{bmatrix}\frac{{x_{1}(t)}}{t} \\\frac{{x_{2}(t)}}{t}\end{bmatrix} = {{A_{c}^{M} \cdot \begin{bmatrix}{x_{1}(t)} \\{x_{2}(t)}\end{bmatrix}} + {B_{c}^{M}{w(t)}}}$v(t) = C_(c)^(M)x(t) + D_(c)^(M)w(t)

with

w(t) denoting the real relative humidity RH at time t in the timedomain,

x1(t) and x2(t) denoting internal states of the second order sensormodel, and

v(t) denoting the sensor model output over time t.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{M} = \begin{bmatrix}{- \frac{T_{1} + T_{2}}{T_{1}T_{2}}} & \frac{1}{T_{1}T_{2}} \\1 & 0\end{bmatrix}},{B_{c}^{M}\begin{bmatrix}1 \\0\end{bmatrix}}$ ${C_{c}^{M} = \begin{bmatrix}\frac{K}{T_{1}T_{2}} & \frac{1}{T_{1}T_{2}}\end{bmatrix}},{D_{c}^{M} = 0}$

For a first order sensor model the time continuous state spacedescription in the control canonical form is:

$\frac{{x(t)}}{t} = {{A_{c}^{M} \cdot {x(t)}} + {B_{c}^{M}{w(t)}}}$v(t) = C_(c)^(M)x(t) + D_(c)^(M)w(t)

again, with

w(t) denoting the real relative humidity RH at time t in the timedomain,

x(t) denoting an internal state of the first order sensor model, and

v(t) denoting the sensor model output over time t.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{M} = {- \frac{1}{T_{1}}}},{B_{c}^{M} = 1},{C_{c}^{M} = \frac{1}{T_{1}}},{D_{c}^{M} = 0}$

Second, the representation in the time continuous domain may betransformed into the time discrete domain.

A time discrete state space representation equivalent to the timecontinuous state space representation for the second order sensor modelmay be:

$\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{A_{d}^{M} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {B_{d}^{M}{w(k)}}}$${v(t)} = {{{C_{d}^{M}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {D_{d}^{M}{{w(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\left( {I - A_{d}^{M}} \right)^{- 1}{B_{d}^{M} \cdot {w(0)}}}}$

where w denotes the measured relative humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There are two internal states x₁(k),x₂(k) of the second order sensor model. This means x(k)=(x₁(k),x₂(k))^(T). v(k) denotes the sensor model output in the discrete timedomain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

A _(d) ^(M) =e ^(A) ^(c) ^(M) ^(T) ^(s) , B _(d) ^(M)=(A _(c) ^(M))⁻¹(e^(A) ^(c) ^(M) ^(T) ^(s) −I)·B _(c) ^(M)

C _(d) ^(M) =C _(c) ^(M) , D _(d) ^(M) =D _(c) ^(M)

In addition,

$I = \begin{bmatrix}1 & 0 \\0 & 1\end{bmatrix}$

and T_(s) is the sampling time.

A time discrete state space representation of the time continuous statespace representation for the first order sensor model may be:

x(k + 1) = A_(d)^(M) ⋅ x(k) + B_(d)^(M) ⋅ w(k)v(k) = C_(d)^(M) ⋅ x(k) + D_(d)^(M) ⋅ w(k)${x(0)} = {\frac{B_{d}^{M}}{1 - A_{d}^{M}}{w(0)}}$

where w(k) denotes the measured relative humidity RH at time step k withthe sampling time t(k+1)−t(k)=T_(s). There is an internal state x(k) ofthe first order sensor model. v(k) denotes the modelled sensor output inthe discrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

${A_{d}^{M} = ^{{- T_{1}}T_{s}}},{B_{d}^{M} = {{- \frac{1}{T_{1}}}\left( {^{{- T_{1}}T_{s}} - 1} \right)}}$C_(d)^(M) = 1, D_(d)^(M) = 0

where T_(s) is the sampling time.

The derivation of the matrices for the first and the second order sensormodel requires Schur decomposition or series expansion and matrixinversion. Computer software may help to calculate the coefficients.

The time discrete state space representations of the first or the secondorder sensor model may be run on a microprocessor, and the parameters T₁or T₁, T₂ and K respectively may be varied until the sensor model outputv(k) is close enough to the real sensor signal u(t) which may be presentin digitized form u(k), too, or may be digitized for comparing purposes.

More sophisticated methodologies for determining the parameters of thesensor model may use system identification tools that automaticallybuild dynamical models from measured data.

Modelling the Compensator:

In a next step, the compensator 3 out of FIG. 2 is determined andimplemented. When the humidity sensor 1 is modelled by a second ordermodel then, advantageously, the compensator is modelled by a secondorder model, too. The transfer function C₂(s) of such a second ordercompensation filter 3—also denoted as compensator—in the frequencydomain may be described by:

$\begin{matrix}{{C_{2}(s)} = \frac{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}{\left( {{Ks} + 1} \right)\left( {{Ps} + 1} \right)}} & \left( {{Eq}.\mspace{14mu} 3} \right)\end{matrix}$

If a first order sensor model is applied, the following first ordercompensation filter is proposed, which may be described by a transferfunction C₁(s) in the frequency domain by:

$\begin{matrix}{{C_{1}(s)} = {\frac{\left( {{T_{1}s} + 1} \right)}{\left( {{Ps} + 1} \right)}.}} & \left( {{Eq}.\mspace{14mu} 4} \right)\end{matrix}$

For both models, s denotes the complex Laplace variable and K, T₁, T₂are the constants that were identified when determining the sensormodel.

C(s) generally denotes the transfer function of the compensation filterin the frequency domain, wherein

RH _(compensated)(s)=C(s)*RH _(sensor)(s)

Preferably, the compensation filter transfer function C(s) is theinverse to the sensor model transfer function G(s), i.e. the diffusionfunction, such that

C(s)=1/G(s)

The term (Ps+1) is introduced in the compensator transfer function tomake the function physically applicable. Parameter P is kept small inorder to keep impact on filter function low, but can be used to filtermeasurement noise.

An important feature of the compensation filter transfer function C(s)is that the final value of C(s) converges to 1, i.e.

${\lim\limits_{s\rightarrow 0}{C(s)}} = 1$

This means that the compensation filter 3 only changes the sensor outputcharacteristic during transition. When the compensation filter 3 is insteady state, it does not affect the sensor output, even if themodelling of the sensor and its housing is inaccurate. Please note thatovershoots may occur if the real system response RH(t) is faster thanmodelled.

Typically, the compensation filter 3 is implemented in a digital systemsuch as a microcontroller which operates on samples of the measuredhumidity rather than on the continuous signal. As a consequence,microcontrollers cannot integrate and not implement differentialequations like those in equation 3 or 4. Therefore, the compensatorneeds to be digitised, i.e. transformed into a set of differenceequations.

First, the differential equations in the spectral domain, i.e. theequations 3 and 4 in the present example, can be reverse transformedinto the time continuous domain by the Laplace back-transform.

For the second order compensation filter the time continuous state spacedescription in the control canonical form is:

$\begin{bmatrix}\frac{{x_{1}(t)}}{t} \\\frac{{x_{2}(t)}}{t}\end{bmatrix} = {{A_{c}^{C} \cdot \begin{bmatrix}{x_{1}(t)} \\{x_{2}(t)}\end{bmatrix}} + {B_{c}^{C}{u(t)}}}$y(t) = C_(c)^(C)x(t) + D_(c)^(C)u(t)

with u(t) denoting the measured humidity at time t in the time domain,i.e. the sensor signal RH_(sensor)(t),

x1(t) and x2(t) denoting internal states of the second ordercompensation filter, and

y(t) denoting the compensated sensor signal, i.e. RH_(compensated)(t)according to FIG. 2.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{C} = \begin{bmatrix}\frac{K + P}{KP} & \frac{1}{KP} \\1 & 0\end{bmatrix}},{B_{c}^{C} = \begin{bmatrix}1 \\0\end{bmatrix}},{D_{c}^{C} = \frac{T_{1}T_{2}}{KP}}$$C_{c}^{C} = \begin{bmatrix}{\frac{T_{1} + T_{2}}{KP} - \frac{T_{1}{T_{2}\left( {K + P} \right)}}{({KP})^{2}}} & {\frac{1}{KP} - \frac{T_{1}T_{2}}{({KP})^{2}}}\end{bmatrix}$

For the first order compensation filter the time continuous state spacedescription in the control canonical form is:

$\frac{{x(t)}}{t} = {{A_{c}^{C} \cdot {x(t)}} + {B_{c}^{C}{u(t)}}}$y(t) = C_(c)^(C)x(t) + D_(c)^(C)u(t)

with u(t) denoting the measured humidity at time t in the time domain,i.e. the sensor signal RH_(sensor)(t) in FIG. 2,

x(t) denoting an internal state of the second order compensation filter,and

y(t) denoting the compensated sensor signal, i.e. RH_(compensated)(t) inFIG. 2.

In this time continuous state space representation, the coefficients A,B, C and D are determined by:

${A_{c}^{C} = {- \frac{1}{P}}},{B_{c}^{C} = 1},{C_{c}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{c}^{C} = \frac{T_{1}}{P}}$

Second, the representation in the time continuous domain may betransformed into the time discrete domain.

A time discrete state space representation of the time continuous statespace representation for the second order compensation filter may be:

$\begin{matrix}{{\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{A_{d}^{C} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {B_{d}^{C}{u(k)}}}}{{y(t)} = {{{C_{d}^{C}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {D_{d}^{C}{{u(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\left( {I - A_{d}^{C}} \right)^{- 1}{B_{d}^{C} \cdot {u(0)}}}}}} & {{Equ}.\mspace{14mu} 5}\end{matrix}$

where u(k) denotes the measured humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There are two internal states of thesecond order compensator, i.e. x(k)=(x₁(k), x₂(k))^(T). y(k) denotes thecompensated sensor signal in the discrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

A _(d) ^(C) =e ^(A) ^(c) ^(C) ^(T) ^(s)

B _(d) ^(C)=(A _(c) ^(C))⁻¹(e ^(A) ^(c) ^(C) ^(T) ^(s) −I)·B _(c) ^(C)

C _(d) ^(C) =C _(c) ^(C)

D _(d) ^(C) =D _(c) ^(C)

A time discrete state space representation of the time continuous statespace representation for the first order compensation filter may be:

x(k + 1) = A_(d)^(C) ⋅ x(k) + B_(d)^(C) ⋅ u(k)y(k) = C_(d)^(C) ⋅ x(k) + D_(d)^(C) ⋅ u(k)${x(0)} = {\frac{B_{d}^{C}}{1 - A_{d}^{C}}{u(0)}}$

where u(k) denotes the measured humidity at time step k with thesampling time t(k+1)−t(k)=T_(s). There is an internal state x(k) of thefirst order compensator. y(k) denotes the compensated sensor signal inthe discrete time domain.

In this time discrete state space representation, the coefficients A, B,C and D are determined by:

${A_{d}^{C} = ^{- {PT}_{s}}},{B_{d}^{C} = {{- \frac{1}{P}}\left( {^{- {PT}_{s}} - 1} \right)}}$${C_{d}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{d}^{C} = \frac{T_{1}}{P}}$

The derivation of the matrices for the first and the second ordercompensation filter requires Schur decomposition or series expansion andmatrix inversion. Computer software may help to calculate thecoefficients.

FIGS. 4A, 4B, and 4C illustrate sample signals, primarily in thediscrete time domain. FIG. 4A illustrates a sample ambient humidity RHover time t. The measured humidity as continuous signal over time isdenoted by u(t), i.e. the sensor signal u(t) supplied by the humiditysensor. The sensor signal u(t) is sampled at points k=0, k=1, . . . withthe sampling time T_(s)=t(k+1)−t(k). u(k) denotes the sampled sensorsignal which is a time discrete signal.

For a second order compensation filter the internal states x1 and x2over sampling points k are illustrated in the graph in FIG. 4B. In thelast graph in FIG. 4C, the compensated sensor signal is illustrated asstep function in the discrete time domain. For illustration purposes, anequivalent Y in the continuous time domain is depicted as dot and dashline.

The compensation effect with respect to a sample humidity characteristicover time is also illustrated in the diagrams of FIGS. 3A, 3B and 3C. InFIG. 3A, the relative humidity in the environment, denoted as “Ambientcondition” is shown as a function of time and includes three step wisechanges and a gradient in form of a ramp. The humidity sensor supplies asensor signal—denoted as “Sensor output”—which exhibits significantresponse times to the fast changes in the Ambient condition. Asmentioned before, the Ambient condition is filtered within the sensorbecause of the internal diffusion dynamics and the dynamics of thehousing. A compensation filter following the sensor supplies acompensated sensor signal—denoted as “Compensated output”. In thepresent example, the compensation filter is implemented as a secondorder model. As can be derived from the diagram, the Compensated outputmuch more resembles the Ambient condition than the sensor output doeswithout a compensator applied to the sensor output. Consequently, thecompensator helps in improving the quality of the measuring system suchthat the overall output of the sensor system including the compensatorprovides for a better quality output especially for fast changes in theAmbient condition. FIG. 3B illustrates the Sensor output and theCompensated Output for another Ambient condition characteristic in formof a saw tooth. In this example, the compensation filter is implementedas a first order model.

The diagrams in FIGS. 5A and 5B support the illustration of a method forimplementing a sensor system according to an embodiment of the presentinvention. In a first step, the sensor itself is modelled for thepurpose of deriving a compensator model from the data that describes thesensor model. In this first step, the real sensor again is exposed to astep wise increase of the measure, i.e. the relative humidity denoted as“Ambient condition” again. The relative humidity RH is increased in asingle step from about 15% to about 65%. The corresponding Sensor outputis measured, and preferably stored. The Sensor output exhibiting aresponse time is plotted in both FIG. 5A and FIG. 5B. Up-front, it isdetermined, that the humidity sensor used may best be represented by afirst order model. Consequently, in a second step, the sensor model isbuilt by means of the transfer function:

${G_{1}(s)} = \frac{1}{\left( {{T_{1}s} + 1} \right)}$

and the parameter T₁ needs to be determined. In order to determine theparameter T₁ such that the output of the sensor model fits the realSensor output as depicted in FIGS. 5A and 5B best, the first order typesensor model is implemented on a microcontroller in the time discretestate space according to the equations that were explained previously:

x(k + 1) = A_(d)^(M) ⋅ x(k) + B_(d)^(M) ⋅ w(k)v(k) = C_(d)^(M) ⋅ x(k) + D_(d)^(M) ⋅ w(k)${x(0)} = {\frac{B_{d}^{M}}{1 - A_{d}^{M}}{w(0)}}$

With coefficients

${A_{d}^{M} = ^{{- T_{1}}T_{s}}},{B_{d}^{M} = {{- \frac{1}{T_{1}}}\left( {^{{- T_{1}}T_{s}} - 1} \right)}}$C_(d)^(M) = 1, D_(d)^(M) = 0

In this time discrete state space representation of the sensor model, aninitial value of the parameter T₁ is chosen, e.g. T₁=6s. The sensormodel output with T₁=6s is illustrated in FIG. 5A. The sensor model isalso run with parameters T₁=8s and T₁=12s. The corresponding sensormodel output is illustrated in FIG. 5A, too.

In a next step, the value of the parameter is chosen that makes thesensor model output come closest to the real sensor signal. From FIG. 5Ait can be derived, that this is the case for T₁=8s. Accordingly, thecomplete transfer function of the sensor model in the frequency domainis

${G_{1}(s)} = \frac{1}{\left( {{8s} + 1} \right)}$

While its representation in the time discrete domain is

x(k + 1) = 0.8465 ⋅ x(k) + 0.9211 ⋅ w(k)v(k) = 0.1667 x(k) + 0 ⋅ w(k)${x(0)} = {\frac{0.9211}{1 - 0.8465}{w(0)}}$

The method can be modified in that the sensor is modelled first with afirst value of the parameter. If the deviation of the sensor outputbased on the model with the first parameter value is too large, anothervalue for the parameter is chosen. Iteratively, as many parameter valuesare chosen as long as there is considered to be sufficient similaritybetween the sensor model output and the real sensor signal, i.e. thedeviation between those two is below a threshold.

In a next step, the compensator model is determined to be a first ordermodel with a general representation in the frequency domain of

${C_{2}(s)} = \frac{{T_{1}s} + 1}{{Ps} + 1}$

The representation in the time discrete state space according to theabove is:

x(k + 1) = A_(d)^(C) ⋅ x(k) + B_(d)^(C) ⋅ u(k)y(k) = C_(d)^(C) ⋅ x(k) + D_(d)^(C) ⋅ u(k)${x(0)} = {\frac{B_{d}^{C}}{1 - A_{d}^{C}}{u(0)}}$

with u(k) denoting the discrete input to the compensator, i.e. thediscrete representation of output of the real sensor, and y(k) denotingthe discrete output of the compensator, i.e. the compensated sensorsignal in the time discrete domain. The corresponding coefficients are:

${A_{d}^{C} = e^{- {PT}_{s}}},{B_{d}^{C} = {{- \frac{1}{P}}\left( {e^{- {PT}_{s}} - 1} \right)}}$${C_{d}^{C} = \frac{P - T_{1}}{P^{2}}},{D_{d}^{C} = \frac{T_{1}}{P}}$

With the determination of the parameter T₁ upon implementation of thesensor model, the coefficients A-D of the compensator can now bedetermined. In this step, parameter P is chosen, too. Parameter Peffects reducing the signal noise.

The compensator can now be implemented. In its time discrete statespace, the compensator is described by:

x(k + 1) = 0.3679 ⋅ x(k) + 0.6321 ⋅ u(k)y(k) = 8.0 ⋅ x(k) + −7.0 ⋅ u(k)${x(0)} = {\frac{0.6321}{1 - 0.3679}{u(0)}}$

The compensator now can be validated on the data measured. P can beadjusted to best performance in the signal to noise ratio SNR.

In the present embodiment, parameter P is chosen as P=1.

The Compensated output is shown in FIG. 5B.

The response time is limited compared to the uncompensated Sensoroutput. The compensator, of course works for all kinds of signals

The diagrams in FIGS. 6A, 6B and 6C support the illustration of a methodfor implementing a sensor system according to another embodiment of thepresent invention. In contrast to the embodiment of FIGS. 5A and 5B thesensor model and the compensator now are described as a second ordermodel. Besides, the steps of implementing the sensor system includingthe compensator are the same as described in connection with FIGS. 5Aand 5B. Again, in a first step, the sensor itself is modelled for thepurpose of deriving a compensator model from the data that describes thesensor model. In this first step, the real sensor again is exposed to astep wise increase of the measure, i.e. the relative humidity denoted as“Ambient condition” again. The relative humidity RH is increased in asingle step from about 15% to about 65%. The corresponding Sensor outputis measured, and preferably stored. The Sensor output exhibiting aresponse time is plotted in all FIGS. 5A, 5B and 5C. Consequently, in asecond step, the sensor model is built by means of the transferfunction:

${G_{2}(s)} = \frac{{Ks} + 1}{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}$

and the parameter T₁, T2 and K need to be determined. In order todetermine the parameter such that the output of the sensor model fitsthe real Sensor output as depicted in FIG. 6A best, the sensor model isimplemented on a microcontroller in the time discrete state spaceaccording to the equations as given above. Initial values of theparameters are chosen and in an iterative way the parameters are setsuch that the output of the sensor model fits the sensor signal of thereal sensor best. In FIG. 6A, there are illustrated multiple outputs ofsensor models implemented with different parameter settings. It can bederived, that the parameter setting of T₁=16, T₂=155, and K=90 fitsbest. With such a parameter setting, the description of the sensor modelin the time discrete state space is finalized.

In a next step, the compensator model is built as a second order modelwith a representation in the frequency domain—including the parametersas determined while building the sensor model, and assuming parameter Pto be set to P=20:

${C_{2}(s)} = \frac{\left( {{16s} + 1} \right)\left( {{155s} + 1} \right)}{\left( {{90s} + 1} \right)\left( {{20s} + 1} \right)}$

This compensator model can be described in the time discrete state spaceby:

$\begin{bmatrix}{x_{1}\left( {k + 1} \right)} \\{x_{2}\left( {k + 1} \right)}\end{bmatrix} = {{\begin{bmatrix}{9.78 \cdot 10^{- 1}} & {{- 2.20} \cdot 10^{- 4}} \\{1.98 \cdot 10^{- 1}} & {1.00 \cdot 10^{- 1}}\end{bmatrix} \cdot \begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {\begin{bmatrix}0.198 \\0.020\end{bmatrix}{u(k)}}}$ ${y(k)} = {{{\begin{bmatrix}{- 0.116} & {- 0.00195}\end{bmatrix}\begin{bmatrix}{x_{1}(k)} \\{x_{2}(k)}\end{bmatrix}} + {2.756{{u(k)}\begin{bmatrix}{x_{1}(0)} \\{x_{2}(0)}\end{bmatrix}}}} = {\begin{bmatrix}0 \\1800\end{bmatrix} \cdot {u(0)}}}$

Again, the compensator now can be validated on the data measured. TheCompensated output is shown in FIG. 6B and FIG. 6C. Both Compensatedoutputs differ in that different parameters P are applied. While in FIG.6B, P is set to P=10, the Compensated output is exposed to significantnoise. In FIG. 6C P is set to P=20 which provides a much better signalto noise ratio SNR.

However, diffusion processes in general depend very much on temperature.Therefore, the model for the compensating filter preferably takestemperature dependency into account—especially if temperature varies bymore than 10-20° C. This can be easily achieved by making the constantsT1, T2, . . . , K, . . . time dependent or by using a set of sensormodels G_(i)(s) and corresponding compensator models C_(i)(s) fordifferent temperature ranges and switching amongst them.

In a preferred embodiment, a second order temperature dependent sensormodel may be described in the frequency domain by:

${G_{2}\left( {s,T} \right)} = \frac{{Ks} + 1}{\left( {{{T_{1}(T)}s} + 1} \right)\left( {{{T_{2}(T)}s} + 1} \right)}$

with T being the temperature.

The corresponding compensation filter may be described by

${C_{2}\left( {s,T} \right)} = \frac{\left( {{{T_{1}(T)}s} + 1} \right)\left( {{{T_{2}(T)}s} + 1} \right)}{\left( {{Ks} + 1} \right)\left( {{Ps} + 1} \right)}$

In the time continuous state space, the following equations representthe temperature dependent compensator:

$\frac{{dx}_{1}(t)}{dt} = {{{a_{11}(T)}x_{1}} + {{a_{12}(T)}x_{2}} + {{b_{1}(T)}{u(t)}}}$$\frac{{dx}_{2}(t)}{dt} = {{{a_{21}(T)}x_{1}} + {{a_{22}(T)}x_{2}} + {{b_{2}(T)}{u(t)}}}$y(t) = c₁x₁ + c₂x₂

In the time discrete state space, the following equations represent thetemperature dependent compensator:

x(k+1)=A _(d) ^(C)(T)·x(k)+B _(d) ^(C)(T)·u(k)

y(k)=C _(c) ^(D)(T)·x(k)+D _(d) ^(C)(T)·u(k)

with coefficients

${A_{d}^{C}(T)} = \begin{bmatrix}{a_{11}^{1} + {a_{12}^{2}T}} & {a_{12}^{1} + {a_{12}^{2}T}} \\{a_{21}^{1} + {a_{21}^{2}T}} & {a_{22}^{1} + {a_{22}^{2}T}}\end{bmatrix}$ ${B_{d}^{C}(T)} = \begin{bmatrix}{b_{1}^{1} + {b_{1}^{2}T}} \\{b_{2}^{1} + {b_{2}^{2}T}}\end{bmatrix}$ ${C_{d}^{C}(T)} = \begin{bmatrix}1 & 1\end{bmatrix}$ D_(d)^(C)(T) = [d¹ + d²T]

The determination of A_(d) ^(C)(T) may be complex. A linearinterpolation of matrix elements may be an appropriate way to determinethe coefficients.

Alternatively, the temperature range is divided into n sub-ranges i,with temperature sub-range i=0 being the first one, and temperaturesub-range i=n being the last one spanning the temperature range covered.For each sub-range i a different sensor model and consequently adifferent compensator model is determined. For example, the followingcompensation filter models are determined in the frequency domain fortemperature sub-ranges [i=0, . . . , i=n]:

-   -   C₂ ¹(s), C₂ ²(s), C₂ ³(s), C₂ ⁴(s), . . . , C₂ ^(n)(s)

And accordingly, the different transfer functions are transformed eachin the time discrete sate space such that for each temperature range acorresponding compensator model, which may be different from thecompensator models for the other temperature ranges, may be provided,stored, and applied whenever the ambient temperature is identified tofall within the corresponding temperature sub-range.

In execution, as illustrated in connection with FIG. 2, the temperaturesensor 2 determines the temperature T and supplies such temperaturesignal to the compensator 3. The compensator 3 determines in whichtemperature sub-range i the measured temperature T falls into, andapplies the compensator model that is defined for such temperaturesub-range. The sensor signal u(t) is then compensated by such selectedcompensator model 3. As a result the entire sensor system comprising thesensor 1, the temperature sensor 2 and the compensator 3 not onlycompensates for response times, it compensates also for temperaturedependencies in the sensor signal. By this means, the sensor system canbe applied to environments with fast changing measures whichenvironments are also characterized to be operated under varyingtemperatures.

Whenever temperature is determined to be in sub-range i, i.e. if T is inT_(i), then k=I and the corresponding compensator model is applied:

x(k+1)=A _(d) ^(k)(T)·x(k)+B _(d) ^(k)(T)·u(k)

y(k)=C _(d) ^(k)(T)·x(k)+D _(d) ^(k)(T)·u(k)

In FIG. 7 there is illustrated a sample temperature range T divided intoi=4 sub-ranges, with [i=0, . . . i=n=4]. The dashed line shows atemperature characteristic taken by the temperature sensor 2 out of FIG.2. The temperature rises first from a temperature in sub-range i=2 to atemperature in sub-range i=3, then falls back to a temperature insub-range i=2, and further drops to a temperature in sub-range i=1.Consequently, during this measurement cycle, three compensator modelsare applied in sequence to the humidity sensor signal, i.e. the modelsi=2, i=3, i=2 again and finally i=1 corresponding to the temperatureranges.

The compensator 3 including its models may preferably be implemented insoftware, in hardware, or in a combination of software and hardware.

Preferably, the sensor system and the corresponding methods may beapplied in the antifogging detection for vehicles. In such application,it is preferred that the sensor 1 is a humidity sensor. The humiditysensor may be arranged on or close to a pane such as a windscreen, forexample. In addition, the temperature sensor may be arranged on or closeto the pane, too, for measuring the ambient temperature, preferably atthe same location the humidity sensor covers.

The results of the measurements may be used to take action against afogged windscreen, for, example, and start operating a blower.

What is claimed is:
 1. A sensor system, comprising a sensor providing asensor signal representative of a measure other than temperature,dynamic components of the sensor signal being dependent on temperature,a temperature sensor for providing a temperature signal, and acompensation filter receiving the sensor signal and the temperaturesignal, wherein the compensation filter is designed for adjusting thedynamic components in the sensor signal subject to the temperaturesignal, and for providing a compensated sensor signal, and wherein thecompensation filter is modeled based on an inverse of a transferfunction of a sensor model of the sensor, which compensation filtercontains temperature dependent terms, said model being provided in aspectral domain.
 2. The sensor system of claim 1, wherein the sensormodel modelled for building the compensation filter is a sensor model ofsecond order.
 3. The sensor system of claim 2, wherein the sensorcomprises a housing, wherein the sensor comprises a sensor elementsensitive to a component in a medium outside the housing, wherein thesensor model of second order represents two diffusion processes, a firstone of which diffusion processes is a diffusion process from the outsideinto the housing, a second one of which diffusion processes is adiffusion process from within the housing into the sensor element. 4.The sensor system of claim 2, wherein the transfer function of thesensor model of second order is${G_{2}(s)} = \frac{{Ks} + 1}{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}$where s denotes the complex Laplace variable, K, T₁, T₂ are constants tobe identified, T₁ and T₂ are time constants of respective diffusionprocesses, and K defines a coupling between the two diffusion processes.5. The sensor system of claim 2, wherein the compensation filter is acompensation filter of second order.
 6. The sensor system of claim 4,wherein a transfer function C₂(s) of the compensation filter is:${C_{2}(s)} = \frac{\left( {{T_{1}s} + 1} \right)\left( {{T_{2}s} + 1} \right)}{\left( {{Ks} + 1} \right)\left( {{Ps} + 1} \right)}$7. The sensor system of claim 1, wherein the sensor model modelled forbuilding the compensation filter is a sensor model of first order. 8.The sensor system of claim 7, wherein the sensor comprises a sensorelement sensitive to a component in a medium outside the housing,wherein the sensor model of first order represents a dominant diffusionprocess for the medium to reach the sensor element.
 9. The sensor systemof claim 7, wherein the transfer function of the sensor model of firstorder is ${G_{1}(s)} = \frac{1}{\left( {{T_{1}s} + 1} \right)}$ wheres denotes the complex Laplace variable, and T₁ is a time constant of therespective diffusion process.
 10. The sensor system of claim 7, whereinthe compensation filter is a compensation filter of first order.
 11. Thesensor system of claim 9, wherein a transfer function C₁(s) of thecompensation filter is:${C_{1}(s)} = \frac{\left( {{T_{1}s} + 1} \right)}{\left( {{Ps} + 1} \right)}$12. The sensor system of claim 1, wherein the compensation filtercomprises a temperature continuous compensation model.
 13. The sensorsystem according to claim 1, wherein the sensor is a humidity sensor.14. The sensor system according to claim 13, wherein the humidity sensorand the temperature sensor are arranged close to a pane of a vehicle fordetecting fogging of the pane.
 15. The sensor system of claim 1, whereinthe compensation filter is designed to decrease a response time of thesensor signal subject to the temperature signal.
 16. The sensor systemof claim 1, wherein the same order selected for the transfer function ofthe sensor model is applied to the transfer function of the compensatingfilter.
 17. A method for adjusting a sensor signal, comprising the stepsof: (a) sensing a temperature, (b) providing a sensor signalrepresentative of a measure other than temperature, dynamic componentsof the sensor signal being dependent on temperature, and (c) by acomputing device configured for doing so, (i) adjusting the dynamiccomponents in the sensor signal subject to the temperature sensed, and(ii) providing a compensated sensor signal, wherein the computing devicecomprises a compensation filter receiving the sensor signal and thetemperature signal, wherein the compensation filter is designed foradjusting the dynamic components in the sensor signal subject to thetemperature signal, and for providing a compensated sensor signal, andwherein the compensation filter is modeled based on an inverse of atransfer function of a sensor model of the sensor, which compensationfilter contains temperature dependent terms, said model being providedin a spectral domain, and wherein said steps are executed on a sensorsystem according to claim
 1. 18. The method according to claim 17,wherein the dynamic components in the sensor signal are adjusted byapplying a temperature continuous compensation model.
 19. The methodaccording to claim 17, wherein the sensor signal represents measuredhumidity, and wherein the compensated sensor signal is used in anantifogging application in a vehicle.